//
//  MZColorButton.m
//  MZBaseDemo
//
//  Created by Chris Yang on 2016/12/2.
//  Copyright © 2016年 Chris Yang. All rights reserved.
//

#import "MZColorButton.h"

@implementation MZColorButton

- (id)init {
    
    self = [super init];
    
    if (self) {
        [self selfConfig];
    }
    
    return self;
}

- (void)selfConfig {
    [self.titleLabel setFont:[UIFont systemFontOfSize:30]];
    [self setTitle:@"待设定" withColor:[UIColor blackColor]];
    [self.titleLabel setAdjustsFontSizeToFitWidth:YES];
}

- (void)setTitle:(NSString *)title withColor:(UIColor *)titleColor {
    
    NSString *realTitle = [NSString stringWithFormat:@"%@ %@", _titlePrefix, title];
    
    [self setTitle:realTitle forState:UIControlStateNormal];
    [self setTitleColor:titleColor forState:UIControlStateNormal];
}

@end
